﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MCorder.programUI
{
    public partial class form_staticset : Form
    {
        public form_staticset(double lowlim, double highlim, double step)
        {
            InitializeComponent();
            set(lowlim, highlim, step);
        }      

        private void set(double lowlim, double highlim, double step)
        {
            textBox_lowlim.Text = lowlim.ToString();
            textBox_highlim.Text = highlim.ToString();
            textBox_step.Text = step.ToString();
            chart1.ChartAreas[0].AxisX.Minimum = lowlim;
            low_limit = lowlim;
            high_limit = highlim;
            interval = step;
            chart1.ChartAreas[0].AxisX.Maximum = highlim;
            chart1.ChartAreas[0].AxisX.MajorGrid.Interval = step;
        }

        public double low_limit, high_limit, interval;

        private void form_staticset_Load_1(object sender, EventArgs e)
        {
            chart1.Series[0].Points.AddXY(0, 0);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            set(Convert.ToInt32(textBox_lowlim.Text), Convert.ToInt32(textBox_highlim.Text), Convert.ToInt32(textBox_step.Text));
        }
    }
}
